﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" debug = "true" AutoEventWireup="true" CodeFile="Find.aspx.cs" Inherits="find" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <title>arf - Find</title>
</asp:Content>


<asp:Content ID="sideBar" ContentPlaceHolderID="masterSideBar" Runat="Server">
    <span id="fff"><a href="feeds.aspx">feeds</a> | <a href="friends.aspx">friends</a> | <a id="currentPage" href="find.aspx">find</a></span>
    
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="mainBody" Runat="Server">
    <div id="defaultContainer">
         <asp:Panel ID="panelAddFriend" runat="server" DefaultButton="btnAddFriend">
            <asp:TextBox ID="FriendInput" runat="server" TabIndex="1"></asp:TextBox>
            <asp:Button ID="btnAddFriend" runat="server" Text="Add/Find Friend" onclick="AddFriend_Click" />    
            <asp:Label ID="lblAddFriend" runat="server"></asp:Label>
        </asp:Panel>
        <br /><br />
        
        <asp:Panel ID="panelAddFeed" runat="server" DefaultButton="btnAddFeed">
            <asp:TextBox ID="FeedInput" runat="server" TabIndex="2"></asp:TextBox>
            <asp:Button ID="btnAddFeed" runat="server" Text="Add Feed" onclick="AddFeed_Click" />
            <asp:Label ID="lblAddFeed" runat="server"></asp:Label>
        </asp:Panel>
        <br /><br />
        
        <asp:Panel ID="panelSearchFeeds" runat="server" DefaultButton="btnSearch">
            <asp:TextBox ID="searchText" runat="server"></asp:TextBox>
            <asp:Button ID="btnSearch" runat="server" Text="Search RSS Feeds" onclick="Search_Click" />
            <asp:Label ID="lblSearchFeeds" runat="server"></asp:Label>    
        </asp:Panel>     
   </div>     
    <asp:Literal ID="Results" runat="server"></asp:Literal>    
   
   
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" OnInserting="On_Inserting_Friend"
        ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>" 
        InsertCommand="INSERT INTO Friends(name1, name2) VALUES (@currentUser,@friend)">
    </asp:SqlDataSource>
    
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" OnInserting="On_Inserting_Feed"
        ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>" 
        InsertCommand="INSERT INTO Subscribe(Name, URL) VALUES (@currentUser,@url)">
    </asp:SqlDataSource>
    
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>" 
        SelectCommand="SELECT [Name] FROM [User] WHERE ([Name] = @AddedName)">
    </asp:SqlDataSource>
    
    <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>" 
        SelectCommand="SELECT * FROM [Friends] WHERE (([name1] = @CurrUser) AND ([name2] = @AddedName))">
    </asp:SqlDataSource>
    
    <asp:SqlDataSource ID="SqlDataSource5" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>" 
        SelectCommand="SELECT * FROM [Subscribe] WHERE (([Name] = @CurrUser) AND ([URL] = @AddedURL))">
    </asp:SqlDataSource>
    
    <asp:SqlDataSource ID="SqlDataSource6" runat="server" OnInserting="On_Inserting_Feed_Title"
        ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>" 
        InsertCommand="INSERT INTO Feed(URL, Title) VALUES (@url,@title)">
    </asp:SqlDataSource>

    <asp:PlaceHolder ID="PlaceHolder1" runat="server" OnDataBinding="PlaceHolder1_Load"></asp:PlaceHolder>
    </asp:Content>



